package com.appkubes.mall.admin.application.activity.apply.apply.dao;

import com.appkubes.mall.admin.application.activity.apply.apply.entity.dto.InspectionManageSupplierDTO;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @Author: Lin Jiaming
 * @Date: 2020/3/5 23:00
 * @Description:
 */
@Mapper
public interface ApplyDao {
    @Select("SELECT apply.activity_key, apply.apply_key,apply.`status`,goods.title,promoter.promoter_name," +
            "apply.create_time FROM mall_activity_apply AS `apply` " +
            "LEFT JOIN mall_activity_source AS `source` ON apply.activity_key=`source`.activity_key " +
            "LEFT JOIN mall_promoter AS promoter ON apply.customer_key=promoter.promoter_key " +
            "LEFT JOIN mall_activity_goods AS activity_goods ON apply.activity_key=activity_goods.activity_key " +
            "LEFT JOIN mall_goods_taobao AS goods ON activity_goods.goods_key=goods.goods_key " +
            "WHERE `source`.source_key='${supplierKey}'")
    List<InspectionManageSupplierDTO> inspectionManageSupplier(Page page, @Param(value = "supplierKey") String supplierKey);

}
